Ext.define('App.datacollection.dclog.model.DcLogDataViewModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.DcLogDataViewModel',
    requires: [],
    data: {
        columns: [{
            header: 'ID',
            dataIndex: 'id',
            hidden: true
        }, {
            header: '操作类型',
            dataIndex: 'operateType',
            width: 20
        }, {
            header: '操作人',
            dataIndex: 'operator',
            width: 20
        }, {
            header: '操作状态',
            dataIndex: 'success',
            width: 20,
            renderer: function (data) {
                if (data) {
                    return "成功";
                }
                return "失败";
            }
        }, {
            header: '采集结果',
            dataIndex: 'collectResult'
        }, {
            header: '操作日期',
            dataIndex: 'operateDate',
            width:20
        }],
        search: {
            simpleSearch: true,
            advancedSearch: true,
            fields: [{
                "field": "operator",
                "name": "操作人",
                opt: 'like'
            }]
        }
    },
    stores: {
        Query: {
            autoLoad: false,
            pageSize: 25,
            remoteSort: false,
            sorters: [{
                property: 'cdt',
                direction: 'ASC'
            }],
            proxy: {
                type: 'majax',
                url: 'collection/dclog/query',
                reader: {
                    type: 'json',
                    rootProperty: 'data',
                    totalProperty: 'total'
                }
            }
        }
    }
});